/** 
 * Base interface for HttpRequests.
 *
 * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
 */
interface HttpRequestInterface
	extends HttpBaseInterface;

/**
 * Gets the verb (GET, PUT, POST) used by the request.
 * 
 * @return	The verb
 */
function String GetVerb();

/**
 * Sets the verb (GET, PUT, POST) used by the request.
 * Should be set before calling ProcessRequest.
 * Defaults to GET.
 *
 * @param	Verb - Verb to use.
 */
function SetVerb(String Verb);

/**
 * Sets the URL for the request (http://my.domain.com/something.ext?key=value&key2=value).
 * Must be set before calling ProcessRequest.
 *
 * @param	URL - URL to use
 */
function SetURL(String URL);

/**
 * Sets the content of the request (optional data).
 * Usually only set for POST requests.
 *
 * @param	ContentPayload - payload to set.
 */
function SetContent(array<byte> ContentPayload);

/**
 * Sets the content of the request as a string encoded as UTF8.
 *
 * @param	ContentString - payload to set.
 */
function SetContentAsString(String ContentString);

/**
 * Sets optional header info.
 * Content-Length is the only header set for you.
 * Required headers depends on the request itself.
 *
 * @param	HeaderName - Name of the header (ie, Content-Type)
 * @param	HeaderValue - Value of the header
 */
function SetHeader(String HeaderName, String HeaderValue);

/**
 * Called to begin processing the request.
 * When a response is recevied, the OnProcessRequestComplete
 * delegate is called with the response.
 *
 * @return	if the request was successfully sent. If false, the delegate will not fire.
 */
function bool ProcessRequest();

/**
 * Delegate called when the request is complete.
 *
 * @param	HttpResponse - The response object
 * @param	bSucceeded - whether the response succeeded. If it did not, you should not trust the payload or headers. 
 *							Basically indicates a net failure occurred while receiving the response.
 */
delegate OnProcessRequestComplete(HttpResponseInterface HttpResponse, bool bSucceeded);

/**
 * Function to allow setting the delegate from the interface object, which can't assign to delegates directly.
 *
 * @param	RequestCompleteDelegate - The delegate to set
 */
function SetRequestCompleteDelegate(delegate<OnProcessRequestComplete> RequestCompleteDelegate);
